<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<script type="text/javascript">
	
	$(function() {
		
		
		 
		$('#merchantAddForm').form({
			url : '${pageContext.request.contextPath}/merchant/add',
			onSubmit : function() {
				progressLoad();
				var isValid = $(this).form('validate');
				if (!isValid) {
					progressClose();
				}
				return isValid;
			},
			success : function(result) {
				progressClose();
				result = $.parseJSON(result);
				if (result.success) {
					parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
					parent.$.modalDialog.handler.dialog('close');
				} else {
					parent.$.messager.alert('错误', result.msg, 'error');
				}
			}
		});
	});
</script>
<div class="easyui-layout" data-options="fit:true,border:false" >
	<div data-options="region:'center',border:false" title="" style="overflow: hidden;padding: 3px;" >
		<form id="merchantAddForm" method="post">
			<table class="grid">
				<tr>
					<td>企业名称</td>
                    <td><input  class="easyui-validatebox" data-options="required:true" type="text" name="companyName"></input></td>
				
					<td>法人或负责人</td>
					<td><input class="easyui-validatebox" data-options="required:true" type="text" name="principal"></input></td>
				</tr>
				<tr>
					<td>营业执照号</td>
					<td><input class="easyui-validatebox" data-options="required:true" type="text" name="businessLicense" ></input></td>
				
					<td>身份证号码</td>
					<td><input class="easyui-validatebox" data-options="required:true" type="text" name="idCard" ></input></td>
				</tr>
				<tr>
					<td>经营网址</td>
					<td><input class="easyui-validatebox" data-options="required:true" type="text" name="url"></input></td>
				
					<td>联系电话</td>
					<td><input class="easyui-validatebox" data-options="required:true" type="text" name="tel"></input></td>
	</tr>			
	<tr>
					<td>经营地址</td>
					<td><input class="easyui-validatebox" data-options="required:true" type="text" name="address"></input></td>
				
				
					<td>邮箱</td>
					<td><input class="easyui-validatebox" data-options="required:true" type="text" name="email"></input></td>
				</tr>
				<tr>
					<td>经营范围</td>
					<td colspan="3"><textarea name="scope" rows="3" cols="70" ></textarea></td>
				</tr>
				<tr>
					<td>营业执照扫描件</td>
					<td colspan="2"><input type="button" value="上传" id="licenseImgUpload"/></input></td>
					<td><input type="hidden" name="licenseImg" ></td>
				</tr>
				<tr>
					<td>法人身份证扫描件</td>
					<td colspan="2"><input type="button" value="上传" id="idCardImgUpload"/></input></td>
					<td><input type="hidden" name="idCardImg" ></td>
				</tr>
			</table>
		</form>
	</div>
</div>
